#include <iostream>
//#pragma pack(1)

struct MyStruct{
    char a; //4
    int b; //4
    short c; //8
    long long d; //8
    char e; //8
}; //32



struct MyStruct2{
    char a; //1
    char e;  //1
    short c; //2
    int b; //4
    long long d;
    char f; //4
};

struct MyStruct3{
    char e;
    char d;
    int a;
    int b;
    long long c;
};
template<typename T>
void fun(T &ss)
{
    std::cout << sizeof(T) << std::endl;

    std::cout << "char a " << static_cast<void *>(&ss.a) << std::endl;
    std::cout << "int b " << static_cast<void *>(&ss.b) << std::endl;
    std::cout << "shrot c " << static_cast<void *>(&ss.c) << std::endl;
    std::cout << "long long d " << static_cast<void *>(&ss.d) << std::endl;
    std::cout << "char e " << static_cast<void *>(&ss.e) << std::endl;
}

int main(void)
{

    MyStruct ss;
    fun<MyStruct>(ss);

    std::cout << "=====================" << std::endl;
    MyStruct2 ss2;
    fun<MyStruct2>(ss2);

    std::cout << "=====================" << std::endl;
    MyStruct3 ss3;
    fun<MyStruct3>(ss3);



    return 0;
}
